package com.bestcem.xm.member.util;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 异步工具类
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/8/25
 */

public class AsyncUtil {

    private final static int CORE_POOL_SIZE = 2;

    private final static int MAX_POOL_SIZE = 5;

    private final static int QUEUE_SIZE = 50;

    private final static Long KEEP_ALIVE = 10L;



    public static final ThreadPoolExecutor threadPoolExecutor =
            new ThreadPoolExecutor(CORE_POOL_SIZE,
                    MAX_POOL_SIZE,
                    KEEP_ALIVE,
                    TimeUnit.SECONDS,
                    new ArrayBlockingQueue(QUEUE_SIZE));
}
